﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using VPBS.Common;

namespace VPBS.SqlClient.DAL
{
    public class TnCustomerVipDAL
    {
        /// <summary>
        /// Lay Call LMV
        /// </summary>
        /// <param ></param>
        /// <returns>Get_CallLMV</returns>
        public static decimal Get_CallLMV(string AccountNo)
        {
            try
            {
                string command =
                    @"select * from customer_vip where account_no='" + AccountNo + "'";
                DataSet ds = SqlHelper.ExecuteDataset(ConnectStringHelper.PortalConnectionString, CommandType.Text,
                                                      command);
                if (ds != null && ds.Tables.Count > 0)
                    return decimal.Parse(ds.Tables[0].Rows[0]["BRK_CALL_LMV"].ToString());
                return 0.35m;
            }
            catch (Exception ex)
            {
                //Logger.Error(typeof(Get_CallLMV), ex);
                return 0.35m;
            }
        }

        /// <summary>
        /// Lay Force LMV
        /// </summary>
        /// <param ></param>
        /// <returns>Get_ForceLMV</returns>
        public static decimal Get_ForceLMV(string AccountNo)
        {
            try
            {
                string command =
                    @"select * from customer_vip where account_no='" + AccountNo + "'";
                DataSet ds = SqlHelper.ExecuteDataset(ConnectStringHelper.PortalConnectionString, CommandType.Text,
                                                      command);
                if (ds != null && ds.Tables.Count > 0)
                    return decimal.Parse(ds.Tables[0].Rows[0]["BRK_FORCE_LMV"].ToString());
                return 0.25m;
            }
            catch (Exception ex)
            {
                //Logger.Error(typeof(Get_ForceLMV), ex);
                return 0.25m;
            }
        }
    }
}
